inspector: Show the pango backend
authorMatthias Clasen <mclasen@redhat.com>
Sun, 28 Jul 2019 15:39:16 +0000 (11:39 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 28 Jul 2019 15:39:16 +0000 (11:39 -0400)
gtk/inspector/general.c
gtk/inspector/general.ui

index f492af2f0ba9140e7557b7de02ff3ab643bc16f3..977671b7492f2e480b30eb05a2f3bc5da3786ad2 100644 (file)
@@ -71,6 +71,7 @@ struct _GtkInspectorGeneralPrivate
   GtkWidget *gtk_version;
   GtkWidget *gdk_backend;
   GtkWidget *gsk_renderer;
+  GtkWidget *pango_fontmap;
   GtkWidget *gl_version;
   GtkWidget *gl_vendor;
   GtkWidget *vk_device;
@@ -625,6 +626,27 @@ init_display (GtkInspectorGeneral *gen)
   populate_display (display, gen);
 }
 
+static void
+init_pango (GtkInspectorGeneral *gen)
+{
+  PangoFontMap *fontmap;
+  const char *type;
+  const char *name;
+
+  fontmap = pango_cairo_font_map_get_default ();
+  type = G_OBJECT_TYPE_NAME (fontmap);
+  if (strcmp (type, "PangoCairoFcFontMap") == 0)
+    name = "fontconfig";
+  else if (strcmp (type, "PangoCairoCoreTextFontMap") == 0)
+    name = "coretext";
+  else if (strcmp (type, "PangoCairoWin32FontMap") == 0)
+    name = "win32";
+  else
+    name = type;
+
+  gtk_label_set_label (GTK_LABEL (gen->priv->pango_fontmap), name);
+}
+
 static void populate_seats (GtkInspectorGeneral *gen);
 
 static void
@@ -793,6 +815,7 @@ gtk_inspector_general_init (GtkInspectorGeneral *gen)
   init_version (gen);
   init_env (gen);
   init_display (gen);
+  init_pango (gen);
   init_gl (gen);
   init_vulkan (gen);
   init_device (gen);
@@ -924,6 +947,7 @@ gtk_inspector_general_class_init (GtkInspectorGeneralClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gtk_version);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gdk_backend);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gsk_renderer);
+  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, pango_fontmap);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gl_version);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gl_vendor);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, vk_device);
index 349c2f49cff82396dce60290edaa99d0fb0b0201..4651befc9b1efcd273a92cdaf76a6dacae739ebd 100644 (file)
                         </child>
                       </object>
                     </child>
+                    <child>
+                      <object class="GtkListBoxRow">
+                        <property name="activatable">0</property>
+                        <child>
+                          <object class="GtkBox">
+                            <property name="margin">10</property>
+                            <property name="spacing">40</property>
+                            <child>
+                              <object class="GtkLabel" id="pango_fontmap_label">
+                                <property name="label" translatable="yes">Pango Fontmap</property>
+                                <property name="halign">start</property>
+                                <property name="valign">baseline</property>
+                                <property name="xalign">0.0</property>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="pango_fontmap">
+                                <property name="selectable">1</property>
+                                <property name="halign">end</property>
+                                <property name="valign">baseline</property>
+                                <property name="hexpand">1</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
       <widget name="gtk_version_label"/>
       <widget name="gdk_backend_label"/>
       <widget name="gsk_renderer_label"/>
+      <widget name="pango_fontmap_label"/>
       <widget name="gl_version_label"/>
       <widget name="gl_vendor_label"/>
       <widget name="vk_device_label"/>